package com.jy.study;


import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Classname PrintA
 * @Description 打印字符串a题目
 * @Date 2019/9/6 16:48
 * @Created by  jiaoyong
 */
public class PrintA {
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {

        List<Integer> list = new ArrayList<Integer>();
        String b ="a";
        //中间写一个方法打印出a
        Method addMethod = list.getClass().getMethod("add", Object.class);
        addMethod.invoke(list,b);
        System.out.println(list);

    }




}
